package com.blb.service.impl;

import com.blb.entity.Shipping;
import com.blb.mapper.ShippingMapper;
import com.blb.service.IShippingService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**/
/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ZhengSaiNan
 * @since 2019-11-16
 */
@Service
public class ShippingServiceImpl extends ServiceImpl<ShippingMapper, Shipping> implements IShippingService {
    @Resource
    private ShippingMapper shippingMapper;
    /**
     * 查询所有订单信息
     * @return
     */
    @Override
    public List<Map<String, Object>> getAllShipMessage(String companyId) {
        return shippingMapper.getAllShipMessage(companyId);
    }

    /**
     * 查询所有订单信息总条数
     * @return
     */
    @Override
    public int countShipMessage(String companyId) {
        return shippingMapper.countShipMessage(companyId);
    }

    /**
     * 查询所有物流
     * @return
     */
    @Override
    public List<Map<String, Object>> getAllLogistics(String companyId) {
        return shippingMapper.getAllLogistics(companyId);
    }
    /**
     * 查询物流车类型
     * @return
     */
    @Override
    public List<String> getAllVehicleType(String logisticsId) {
        return shippingMapper.getAllVehicleType(logisticsId);
    }
    /**
     * 查询司机信息
     * @param logisticsId
     * @param vehicle_type
     * @return
     */
    @Override
    public List<Map<String, Object>> getAllDriverMessage(String logisticsId, String vehicle_type) {
        return shippingMapper.getAllDriverMessage(logisticsId,vehicle_type);
    }
    /**
     * 更改订单状态、物流信息
     * @param shipping
     */
    @Override
    public void updateOrder(Shipping shipping) {
        shippingMapper.updateOrder(shipping);
    }

    @Override
    public Map<String, Object> getDetailMessage(String orderNum) {
        return shippingMapper.getDetailMessage(orderNum);
    }
    /**
     * 更改车辆状态
     * @param vehicleId
     */
    @Override
    public void updateVehicle(String vehicleId) {
        shippingMapper.updateVehicle(vehicleId);
    }
    /**
     * 更改司机状态
     * @param driverId
     */
    @Override
    public void updateDriver(String driverId) {
        shippingMapper.updateDriver(driverId);
    }
}
